package com.jeeplus.cms.config.sitemesh;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author WuXilin
 */
@Controller
public class DecoratorController {

    private static final String BLANK_THEME = "blank";

    @RequestMapping("/decorators/{theme}")
    public String defaultDecorator(@PathVariable String theme) {
        if (BLANK_THEME.equals(theme)) {
            return "layouts/"+theme;
        }
        return "/themes/" + theme + "/layouts/" + theme;
    }
}
